package net.scribblemedia.sqldsk.displaytag;

import net.scribblemedia.sqldsk.domain.ReportRow;

import org.displaytag.decorator.TableDecorator;

public class ReportTableDecorator extends TableDecorator {
	private static final String REPORT_ROW_ID_PREFIX = "reportRow_";
	private static final String ARCHIVED = "ARCHIVED";

	@Override
	public String addRowClass() {
		ReportRow reportRow = (ReportRow) getCurrentRowObject();
		return reportRow.isArchived() ? ARCHIVED : "" +  reportRow.getReportRowState();
	}
	
	@Override
	public String addRowId() {
		ReportRow reportRow = (ReportRow) getCurrentRowObject();
		return REPORT_ROW_ID_PREFIX + reportRow.getId();
	}
	
}
